<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var func = function(num) {
            arr1 = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
            arr2 = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'];
            arr3 = ['', 'C'];
            var array = ['', '', ''];
            var i3 = Math.floor(num / 100);
            if (i3 > 0) array[0] = arr3[i3];
            num = num % 100;
            var i2 = Math.floor(num / 10);
            if (i2 > 0) array[1] = arr2[i2];
            num = num % 10;
            if (num > 0) array[2] = arr1[num];
            return array.join('');
        };
    </script>
</body>

</html>